﻿<div ng-controller="merchantController">
    <div class="wrapper border-bottom white-bg page-heading">
        <div class="col-lg-pull-12">
            <ol class="breadcrumb">
                <li><a ui-sref="app.member.list">商户列表</a></li>
                <li class="active">商户下级</li>
            </ol>
        </div>
    </div>
    <form class="form-horizontal row">
        <div class="form-group col-sm-4">
            <label class="col-sm-4 control-label">姓名</label>
            <div class="col-sm-8">
                <input type="text" class="form-control input-sm" ng-model="query.name">
            </div>
        </div>
        <div class="form-group col-sm-4">
            <label class="col-sm-4 control-label">手机</label>
            <div class="col-sm-8">
                <input type="text" class="form-control input-sm" ng-model="query.mobile">
            </div>
        </div>
        <div class="form-group col-sm-4">
            <label class="col-sm-4 control-label">用户状态</label>
            <div class="col-sm-8">
                <select class="form-control input-sm" ng-model="query.disable">
                    <option value="">全部</option>
                    <option value="false">启用</option>
                    <option value="true">禁用</option>
                </select>
            </div>
        </div>
        <div class="form-group col-sm-4">
            <label class="col-sm-4 control-label">注册时间</label>
            <div class="col-sm-8">
                <div date class="input-group date">
                    <input class="form-control input-sm" ng-model="query.start_time">
                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                </div>
            </div>
        </div>
        <div class="form-group col-sm-4">
            <div class="col-sm-8">
                <div date class="input-group date">
                    <input class="form-control input-sm" ng-model="query.end_time">
                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                </div>
            </div>
        </div>
        <div class="form-group col-sm-4">
            <label class="col-sm-4 control-label">用户等级</label>
            <div class="col-sm-8">
                <select class="form-control input-sm" ng-model="query.grade_id" ng-options="item.id as item.name for item in grades">
                    <option value="">全部</option>
                </select>
            </div>
        </div>
        <div class="form-group col-sm-4">
            <label class="col-sm-4 control-label"></label>
            <div class="col-sm-8">
                <a class="btn btn-primary btn-sm" ui-sref="app.member.list(query)"><i class="fa fa-search"></i> 查询</a>
                <button class="btn btn-primary btn-sm" ng-click="search()"><i class="fa fa-refresh"> 刷新</i></button>
            </div>
        </div>
    </form>
    <!--<ul class="nav nav-tabs">
        <li role="presentation" ng-class="{'active':query.auth_status==''}"><a ui-sref="app.member.list({auth_status:''})">全部</a></li>
        <li role="presentation" ng-class="{'active':query.auth_status=='1'}"><a ui-sref="app.member.list({auth_status:'1'})">待认证审核</a></li>
        <li role="presentation" ng-class="{'active':query.auth_status=='2'}"><a ui-sref="app.member.list({auth_status:'2'})">审核不通过</a></li>
        <li role="presentation" ng-class="{'active':query.auth_status=='3'}"><a ui-sref="app.member.list({auth_status:'3'})">审核通过</a></li>
        <li role="presentation" ng-class="{'active':query.auth_status=='0'}"><a ui-sref="app.member.list({auth_status:'0'})">未认证</a></li>
    </ul>-->
    <table class="table table-hover m-t-md" id="table">
        <thead>
            <tr>
                <th>姓名</th>
                <th>账户</th>
                <th>等级</th>
                <th>注册时间</th>
                <th>登陆时间</th>
                <th>状态</th>
                <th width="150">操作</th>
            </tr>
        </thead>
        <tbody ng-repeat="item in model.rows" style="border: 0;">
            <tr>
                <td><span ng-if="item.depth!=2" style="padding-left:{{5*(item.depth-1)}}px;"></span>{{item.name}}</td>
                <td>{{item.mobile}}</td>
                <td>{{item.grade_name}}</td>
                <td>{{item.create_time}}</td>
                <td>{{item.login_time}}</td>
                <td>{{item.auth_status_name}}</td>
                <td><a href="javascript:void(0);" ng-click="is_show(item.id)">查看下级</a></td>
            </tr>
            <tr ng-repeat="child in childs[item.id].rows" ng-show="childs[item.id].show">
                <td><span ng-if="child.depth!=2" style="padding-left:{{5*(child.depth-1)}}px;"></span>{{child.name}}</td>
                <td>{{child.mobile}}</td>
                <td>{{child.grade_name}}</td>
                <td>{{child.create_time}}</td>
                <td>{{child.login_time}}</td>
                <td>{{child.auth_status_name}}</td>
                <td><a href="javascript:void(0);" ng-click="is_show(child.id)">查看下级</a></td>
            </tr>
        </tbody>
    </table>
    <div class="row">
        <div class="col-md-12">
            <uib-pagination total-items="model.total_result" items-per-page="model.size" ng-model="model.page" num-pages="model.total_pages"
                            ng-change="search_page(model.page)" class="pagination-sm" boundary-links="true" boundary-link-numbers="true" max-size="20"
                            previous-text="&lsaquo;" next-text="&rsaquo;" first-text="&laquo;" last-text="&raquo;"></uib-pagination>
            <span class="pull-right" style="margin: 30px 0px 20px 0px">共{{model.total_result}} 当前：{{model.page}}/{{model.total_pages}}</span>
        </div>
    </div>
</div>
